package cn.test.mapper;

import cn.test.pojo.ActivityVo;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @Author:ggj
 * @Date:2020/04/07/21:24
 * @Description:
 */
public interface ActivityVoMapper extends Mapper<ActivityVo> {

    //查询活动的所有信息
    @Select("SELECT a.*,t.type FROM activity a JOIN type t ON a.typeId=t.id order by a.id")
    List<ActivityVo> queryAll();

    @Select("SELECT a.*,t.type FROM activity a JOIN TYPE t ON a.typeId=t.id WHERE a.id=#{id}")
    ActivityVo findById(Integer id);
}
